
#ifndef OMPINTERFACE_H_
#define OMPINTERFACE_H_

#include "open_mp/ompTypes.h"
#include "open_mp/ParallelFwd3.h"
#include "open_mp/ParallelFwd2.h"
#include "SubscriptionManager.h"
#include "../Packets/PubPkt.h"
#include "../Packets/BackSubPkt.h"
#include <set>
#include <boost/unordered_map.hpp>
#include <iostream>
#include "../Common/Consts.h"
#include "SubscriptionManager.h"

#define MAX_NUM_INTERFACES 10

class OMPInterface : public SubscriptionManager {

public:

	typedef struct {
		int interface;
	} InnerInterface;

	OMPInterface();

	virtual ~OMPInterface();

	void processEvent(PubPkt* pkt, Outbox &outbox);

	void installSubscription(Inbox* inbox);

	void deleteSubscription(Inbox* inbox);

private:

	ParallelFwd3 *fwdTable;

	boost::unordered_map<int, std::set<OMPFilter *> > OMPForwardingMap;
	boost::unordered_map<BackSubPkt*, OMPFilter*> subscriptionToFilterMap;

	int interfaces[MAX_NUM_INTERFACES];
//	boost::unordered_map<int, InnerInterface> interfacesMap;

	OMPFilter* translate(BackSubPkt* pkt);
	OMPMessage* translate(PubPkt* pkt);

};


#endif /* OMPINTERFACE_H_ */
